//
//  HJDHomeController.m
//  JYHospital
//
//  Created by 胡金东 on 16/3/31.
//  Copyright © 2016年 胡金东. All rights reserved.
//

#import "HJDPofileControllerr.h"
#import "HJDWeightViewController.h"
#import "HJDNumberViewController.h"
#import "WaterWareView.h"
#import "MBProgressHUD.h"


@interface HJDPofileControllerr ()<UIScrollViewDelegate,UITableViewDataSource,UITableViewDelegate>

@property (nonatomic,strong)NSTimer *timer;

@property (nonatomic,strong)UIScrollView *scroll;

@property (nonatomic,strong)UIScrollView *textscroll;

@property (nonatomic,strong) UITableView * tableView;

//
@property (nonatomic,strong)  UILabel *textLbl;
@property (nonatomic,strong)  UIView *viewLbl;

@property (nonatomic,strong) UILabel *twoLbl;
//背景
@property (nonatomic,strong) UIView * backgroundView;
//动画

@property (nonatomic,strong) WaterWareView *waterWareView;




@end

@implementation HJDPofileControllerr



-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    //隐藏导航栏
    self.navigationController.navigationBarHidden = YES;
    
}


- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor getColorWithHexNumber:@"FFFFFF"];
    

    
    [self setUpNavi];
    
    [self setUpInfo];

    [self setUpBtn];
    
    [self setUpCell];
    
 
     
}


-(void)setUpNavi
{
    
    self.scroll = [[UIScrollView alloc]initWithFrame:[UIScreen mainScreen].bounds];
    self.scroll.delegate = self;
    
    self.automaticallyAdjustsScrollViewInsets = YES;
    self.scroll.showsVerticalScrollIndicator = NO;//垂直移动
    self.scroll.showsHorizontalScrollIndicator = NO;//水平移动
    //上下滑动
    self.scroll.contentSize = CGSizeMake(HJDWidth,610 ) ;
    [self.view addSubview: self.scroll];
//    背景
    self.backgroundView = [[UIView alloc]initWithFrame:CGRectMake(0, 0,HJDWidth ,450 )];
    self.backgroundView.backgroundColor = [UIColor getColorWithHexNumber:@"FE93A2"];
    [self.scroll addSubview:self.backgroundView];
//    动画
    self.waterWareView = [[WaterWareView alloc]initWithFrame:CGRectMake(0, 10, HJDWidth, 440)];
    [self.backgroundView addSubview:self.waterWareView];
    
    CGFloat leftX = HJDHorizontalMargin;
    CGFloat leftY = HJDVerticalMargin;
    CGFloat leftW = 9;
    CGFloat leftH = 35/2;
    UIButton *navleftBtn = [[UIButton alloc]initWithFrame:CGRectMake(leftX, leftY, leftW, leftH)];
    [navleftBtn setBackgroundImage:[UIImage imageNamed:@"孕期管理返回"] forState:UIControlStateNormal];
    [navleftBtn addTarget:self action:@selector(Back) forControlEvents:UIControlEventTouchUpInside];
    [navleftBtn setBackgroundColor:[UIColor getColorWithHexNumber:@"CFCFCF"]];
    [self.backgroundView addSubview:navleftBtn];
    
   
     UIView *circle = [[UIView alloc]initWithFrame:CGRectMake((HJDWidth - 188)/2, 20, 376/2, 81/2)];
    UIImage *img = [UIImage imageNamed:@"圆角矩形"];
    [circle setBackgroundColor:[UIColor colorWithPatternImage:img]];
    [self.backgroundView addSubview:circle];
  
    UILabel *timeLbl = [[UILabel alloc]init];
    timeLbl.text = @"6周";
    timeLbl.font = [UIFont fontWithName:@"HelveticaNeue" size:19];

    CGSize  timeLblSize = [timeLbl.text sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:timeLbl.font,NSFontAttributeName ,nil]];
    timeLbl.textAlignment = NSTextAlignmentCenter;
    CGFloat timeLblX = 188/2 - timeLblSize.width/2 -10;
    CGFloat timeLblY = 7;
    timeLbl.frame = (CGRect){{timeLblX,timeLblY +5},timeLblSize};
    timeLbl.textColor = [UIColor getColorWithHexNumber:@"5CC5AC"];
    [circle addSubview:timeLbl];
    
    UILabel *timeDayLbl = [[UILabel alloc]init];
    timeDayLbl.text = @"6天";
    timeDayLbl.font = [UIFont fontWithName:@"HelveticaNeue" size:19];

    CGSize  timeDayLblSize = [timeLbl.text sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:timeLbl.font,NSFontAttributeName ,nil]];
    timeDayLbl.textAlignment = NSTextAlignmentCenter;
    CGFloat timeDayLblX = CGRectGetMaxX(timeLbl.frame);
    CGFloat timeDayLblY = 7;
    timeDayLbl.frame = (CGRect){{timeDayLblX,timeDayLblY +5},timeDayLblSize};
    timeDayLbl.textColor = [UIColor getColorWithHexNumber:@"5CC5AC"];
    [circle addSubview:timeDayLbl];
    
    

    CGFloat leftBtnW = 34;
    CGFloat leftBtnH = 69/2;
    CGFloat leftBtnX = 1;
    CGFloat leftBtnY = 3;
    
    UIButton *leftBtn = [[UIButton alloc]initWithFrame:CGRectMake(leftBtnX, leftBtnY, leftBtnW, leftBtnH)];
    leftBtn.backgroundColor = [UIColor getColorWithHexNumber:@"CFCFCF"];
    [leftBtn setBackgroundImage:[UIImage imageNamed:@"孕期上"] forState:UIControlStateNormal];
    [leftBtn setRadius:leftBtnW/2 borderWith:0 borderColor:nil];
    [leftBtn addTarget:self action:@selector(upDayClick) forControlEvents:UIControlEventTouchUpInside];
    [circle addSubview:leftBtn];
    
    CGFloat rightBtnW = leftBtnW;
    CGFloat rightBtnH = leftBtnH;
    CGFloat rightBtnX = 188 - leftBtnW -1 ;
    CGFloat rightBtnY = 3;
    
    UIButton *rightBtn = [[UIButton alloc]initWithFrame:CGRectMake(rightBtnX, rightBtnY, rightBtnW, rightBtnH)];
   rightBtn.backgroundColor = [UIColor getColorWithHexNumber:@"CFCFCF"];
    [rightBtn setBackgroundImage:[UIImage imageNamed:@"孕期下"] forState:UIControlStateNormal];
  [rightBtn setRadius:leftBtnW/2 borderWith:0 borderColor:nil];
    [rightBtn addTarget:self action:@selector(nextDayClick) forControlEvents:UIControlEventTouchUpInside];
    [circle addSubview:rightBtn];
    

    UILabel *dayLbl = [[UILabel alloc]init];
    dayLbl.text = @"4";
    dayLbl.font = [UIFont fontWithName:@"HelveticaNeue" size:15];
    CGSize  dayLblSize = [dayLbl.text sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:dayLbl.font,NSFontAttributeName ,nil]];
    CGFloat dayLblX = (HJDWidth-dayLblSize.width)/2 + 15 ;
    CGFloat dayLblY = leftY + leftH + HJDVerticalMargin * 2;
    dayLbl.frame = (CGRect){{dayLblX,dayLblY},dayLblSize};
    dayLbl.textAlignment = NSTextAlignmentCenter;
    dayLbl.textColor = [UIColor getColorWithHexNumber:@"FFFFFD"];
    [self.backgroundView addSubview:dayLbl];
    
    UILabel *dateLbl = [[UILabel alloc]init];
    dateLbl.text = @"26.";
    dateLbl.font = [UIFont fontWithName:@"HelveticaNeue" size:24];
    CGSize  dateLblSize = [dateLbl.text sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:dateLbl.font,NSFontAttributeName ,nil]];
    CGFloat dateLblX = (HJDWidth-dateLblSize.width)/2 - 5;
    CGFloat dateLblY = leftY + leftH + 31;
    dateLbl.frame = (CGRect){{dateLblX,dateLblY},dateLblSize};
    dateLbl.textAlignment = NSTextAlignmentCenter;
    dateLbl.textColor = [UIColor getColorWithHexNumber:@"FFFFFD"];
    [self.backgroundView addSubview:dateLbl];

    

    CGFloat viewW = 150;
    CGFloat viewH = 150;
    CGFloat viewX = (HJDWidth - viewW)/2;
    CGFloat viewY = CGRectGetMaxY(dayLbl.frame) + HJDVerticalMargin/2;
    self.viewLbl = [[UIView alloc]init];
    self.viewLbl.frame = CGRectMake(viewX, viewY, viewW, viewH);
    [self.viewLbl setRadius:viewW/2 borderWith:0 borderColor:[UIColor whiteColor]];
    self.viewLbl.backgroundColor = [UIColor getColorWithHexNumber:@"5CC6AB"];
    [self.backgroundView addSubview:self.viewLbl];
    
  
    
//    咨询
    CGFloat btnResultW = 146/2;
    CGFloat btnResultH = 64/2;
    CGFloat btnResultX = CGRectGetMaxX(self.viewLbl.frame) + HJDHorizontalMargin/2;
    CGFloat btnResultY = CGRectGetMaxY(self.viewLbl.frame) - btnResultH ;
    UIButton *btnResult = [[UIButton alloc]initWithFrame:CGRectMake(btnResultX, btnResultY, btnResultW, btnResultH)];
    
    [btnResult addTarget:self action:@selector(resultClick) forControlEvents:UIControlEventTouchUpInside];
    [btnResult setRadius:30/2 borderWith:0 borderColor:[UIColor whiteColor]];
    btnResult.backgroundColor = [UIColor getColorWithHexNumber:@"FFFFFD"];
    [btnResult setImage:[UIImage imageNamed:@"咨询"] forState:UIControlStateNormal];
    [self.backgroundView addSubview:btnResult];
    
    CGFloat LblX = 33;
    CGFloat LblY = 6;
    CGFloat LblW = 35;
    CGFloat LblH = 20;
    UILabel *Lbl = [[UILabel alloc]initWithFrame:CGRectMake(LblX, LblY, LblW, LblH)];
    Lbl.text = @"咨询";
    Lbl.font = [UIFont systemFontOfSize:15];
    Lbl.textColor = [UIColor getColorWithHexNumber:@"848484"];
    [btnResult addSubview:Lbl];

    
   
    
 
}


-(void)setUpInfo
{

    CGFloat gestationLblX = HJDHorizontalMargin;
    CGFloat gestationLblY = CGRectGetMaxY(self.viewLbl.frame)+HJDVerticalMargin * 2;
    CGFloat gestationLblW = 100;
    CGFloat gestationLblH = 15;
    UILabel *gestationLbl = [[UILabel alloc]initWithFrame:CGRectMake(gestationLblX, gestationLblY, gestationLblW, gestationLblH)];
    gestationLbl.text = @"距离预产期";
    gestationLbl.font = [UIFont systemFontOfSize:15];
    gestationLbl.textColor = [UIColor getColorWithHexNumber:@"FFFFFD"];
  
    [self.waterWareView addSubview:gestationLbl];
    
    CGFloat gesDayLblX = HJDHorizontalMargin;
    CGFloat gesDayLblY = CGRectGetMaxY(gestationLbl.frame);
//    CGFloat gesDayLblW = 100;
//    CGFloat gesDayLblH = 30;
    UILabel *gesDayLbl = [[UILabel alloc]init];
        gesDayLbl.text = @"268";
    gesDayLbl.font = [UIFont systemFontOfSize:30];
    CGSize  gesDayLblSize = [gesDayLbl.text sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:gesDayLbl.font,NSFontAttributeName ,nil]];
    gesDayLbl.frame = (CGRect){{gesDayLblX,gesDayLblY},gesDayLblSize};
    gesDayLbl.textColor = [UIColor getColorWithHexNumber:@"FFFFFD"];
    [self.waterWareView addSubview:gesDayLbl];
    
    CGFloat gesDayLbllX = CGRectGetMaxX(  gesDayLbl.frame);
    CGFloat gesDayLbllY = CGRectGetMaxY(gestationLbl.frame)+7;
    CGFloat gesDayLbllW = 30;
    CGFloat gesDayLbllH = 30;
    UILabel *gesDayLbll = [[UILabel alloc]initWithFrame:CGRectMake(gesDayLbllX, gesDayLbllY, gesDayLbllW, gesDayLbllH)];
    gesDayLbll.text = @"天";
    gesDayLbll.font = [UIFont systemFontOfSize:15];
    gesDayLbll.textColor = [UIColor getColorWithHexNumber:@"FFFFFD"];
    [self.waterWareView addSubview:gesDayLbll];
    
    CGFloat babyLblX = CGRectGetMaxX(gestationLbl.frame) + 18;
    CGFloat babyLblY = CGRectGetMaxY(self.viewLbl.frame)+HJDVerticalMargin * 2;
    CGFloat babyLblW = 100;
    CGFloat babyLblH = 15;
    UILabel *babyLbl = [[UILabel alloc]initWithFrame:CGRectMake(babyLblX, babyLblY, babyLblW, babyLblH)];
    babyLbl.text = @"宝宝头臂长";
    babyLbl.font = [UIFont systemFontOfSize:15];
    babyLbl.textColor = [UIColor getColorWithHexNumber:@"FFFFFD"];

    [self.waterWareView addSubview:babyLbl];
    
    CGFloat babyHightLblX = babyLblX;
    CGFloat babyHightLblY = CGRectGetMaxY(gestationLbl.frame);
    UILabel *babyHightLbl = [[UILabel alloc]init];
    babyHightLbl.text = @"12";
    babyHightLbl.font = [UIFont systemFontOfSize:30];
    babyHightLbl.textColor = [UIColor getColorWithHexNumber:@"FFFFFD"];
    CGSize  babyHightLblSize = [babyHightLbl.text sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:babyHightLbl.font,NSFontAttributeName ,nil]];
    babyHightLbl.frame = (CGRect){{babyHightLblX,babyHightLblY},babyHightLblSize};
    [self.waterWareView addSubview:babyHightLbl];
    
    CGFloat babyHightLbllX = CGRectGetMaxX(babyHightLbl.frame);
    CGFloat babyHightLbllY = babyHightLblY + 9;
    CGFloat babyHightLbllW = 30;
    CGFloat babyHightLbllH = 30;
    UILabel *babyHightLbll = [[UILabel alloc]initWithFrame:CGRectMake(babyHightLbllX, babyHightLbllY, babyHightLbllW, babyHightLbllH)];
    babyHightLbll.text = @"mm";
    babyHightLbll.font = [UIFont systemFontOfSize:15];
    babyHightLbll.textColor = [UIColor getColorWithHexNumber:@"FFFFFD"];
    [self.waterWareView addSubview:babyHightLbll];

    
    CGFloat babyWeightLblX = CGRectGetMaxX(babyLbl.frame) + 18;
    CGFloat babyWeightLblY = CGRectGetMaxY(self.viewLbl.frame)+HJDVerticalMargin * 2;
    CGFloat babyWeightLblW = 100;
    CGFloat babyWeightLblH = 15;
    UILabel *babyWeightLbl = [[UILabel alloc]initWithFrame:CGRectMake(babyWeightLblX, babyWeightLblY, babyWeightLblW, babyWeightLblH)];
    babyWeightLbl.text = @"宝宝体重";
    babyWeightLbl.font = [UIFont systemFontOfSize:15];
    babyWeightLbl.textColor = [UIColor getColorWithHexNumber:@"FFFFFD"];

  
    [self.waterWareView addSubview:babyWeightLbl];
    
    CGFloat babyWNumberLblX = babyWeightLblX;
    CGFloat babyWNumberLblY = CGRectGetMaxY(gestationLbl.frame);
    UILabel *babyWNumberLbl = [[UILabel alloc]init];
    babyWNumberLbl.text = @"0.9";
    babyWNumberLbl.textColor = [UIColor getColorWithHexNumber:@"FFFFFD"];
     babyWNumberLbl.font = [UIFont systemFontOfSize:30];
    CGSize  babyWNumberLblSize = [babyWNumberLbl.text sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:babyWNumberLbl.font,NSFontAttributeName ,nil]];
    babyWNumberLbl.frame = (CGRect){{babyWNumberLblX,babyWNumberLblY},babyWNumberLblSize};
   
    [self.waterWareView addSubview:babyWNumberLbl];
    
    CGFloat babyWNumberLbllX = CGRectGetMaxX(babyWNumberLbl.frame);
    CGFloat babyWNumberLbllY = CGRectGetMaxY(gestationLbl.frame) +7;
    CGFloat babyWNumberLbllW = 30;
    CGFloat babyWNumberLbllH = 30;
    UILabel *babyWNumberLbll = [[UILabel alloc]initWithFrame:CGRectMake(babyWNumberLbllX, babyWNumberLbllY, babyWNumberLbllW, babyWNumberLbllH)];
    babyWNumberLbll.text = @"g";
    babyWNumberLbll.font = [UIFont systemFontOfSize:15];
    babyWNumberLbll.textColor = [UIColor getColorWithHexNumber:@"FFFFFD"];
    [self.waterWareView addSubview:babyWNumberLbll];
    
    
    self.textscroll = [[UIScrollView alloc]initWithFrame:CGRectMake(20,CGRectGetMaxY(babyWNumberLbl.frame) + HJDVerticalMargin/2,HJDWidth - HJDHorizontalMargin *2 , 70)];
    self.textscroll.delegate = self;
    
    self.automaticallyAdjustsScrollViewInsets = YES;
    self.textscroll.showsVerticalScrollIndicator = YES;//垂直移动
    self.textscroll.showsHorizontalScrollIndicator = NO;//水平移动
   
    
    [self.waterWareView addSubview:self.textscroll];
   
//        文字说明
    self.textLbl = [[UILabel alloc]init];
    self.textLbl.text = @"细胞植入处胎盘开始形成，来自母体循环系统中的血液开始在胎盘内循环，供给胎儿在母体发育所需养分。此时，早孕试纸测试出自己是否已经怀孕。失联飞机老师就分了就萨拉飞机垃圾分类就爱上了咖啡就开了房间了撒娇方式数据库放垃圾死了就发啦送积分卡刷卡；福克斯；开发商";
    self.textLbl.textColor = [UIColor getColorWithHexNumber:@"FFFFFD"];
    self.textLbl.font = [UIFont fontWithName:@"HelveticaNeue" size:15];
    CGFloat textLblX = 0;
    CGFloat textLblY = 0;
    CGFloat textLblW = HJDWidth - HJDHorizontalMargin *2;
//    又一种计算方法
    CGSize textLblSize = [self.textLbl.text boundingRectWithSize:CGSizeMake(textLblW, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObjectsAndKeys:self.textLbl.font,NSFontAttributeName, nil] context:nil].size;
    self.textLbl.frame = (CGRect){{textLblX,textLblY},textLblSize};
    self.textLbl.numberOfLines = 0;
    
    [self.textscroll addSubview:self.textLbl];
    //上下滑动
    self.textscroll.contentSize = CGSizeMake(HJDWidth - HJDHorizontalMargin *2, textLblSize.height) ;
    
    
 
    

}



//按钮
-(void)setUpBtn
{

    CGFloat btnOneX = 50;
    CGFloat btnOneY = CGRectGetMaxY(self.backgroundView.frame) + HJDVerticalMargin ;
    CGFloat btnOneW = 122/2;
    CGFloat btnOneH = 134/2;
    UIButton *btnOne = [[UIButton alloc]initWithFrame:CGRectMake(btnOneX, btnOneY, btnOneW, btnOneH)];
//    [btnOne setBackgroundColor:[UIColor getColorWithHexNumber:@"FE93A2"]];
    [btnOne setBackgroundImage:[UIImage imageNamed:@"数胎动"] forState:UIControlStateNormal];
    [btnOne addTarget:self action:@selector(oneClick) forControlEvents:UIControlEventTouchUpInside];
//    [btnOne setRadius:btnOneW/2 borderWith:0 borderColor:[UIColor getColorWithHexNumber:@"FE93A2"]];
    [self.scroll addSubview:btnOne];
    
    
    UILabel *oneLbl = [[UILabel alloc]init];
    oneLbl.text = @"数胎动";
    oneLbl.font = [UIFont fontWithName:@"HelveticaNeue" size:14];
    CGSize  oneLblSize = [oneLbl.text sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:oneLbl.font,NSFontAttributeName ,nil]];
    CGFloat oneLblX = btnOneX + btnOneW/2 -oneLblSize.width/2;
    CGFloat oneLblY = CGRectGetMaxY(btnOne.frame) +HJDVerticalMargin/2 ;
    oneLbl.frame = (CGRect){{oneLblX,oneLblY},oneLblSize};
//    oneLbl.textAlignment = NSTextAlignmentCenter;
    oneLbl.textColor = [UIColor getColorWithHexNumber:@"848484"];
    [self.scroll addSubview:oneLbl];
    
    
    CGFloat btnTwoX = HJDWidth - 50 - 61;
    CGFloat btnTwoY = btnOneY + 7;
    CGFloat btnTwoW = 61;
    CGFloat btnTwoH = 61;
    UIButton *btnTwo = [[UIButton alloc]initWithFrame:CGRectMake(btnTwoX, btnTwoY, btnTwoW, btnTwoH)];
//    [btnTwo setBackgroundColor:[UIColor getColorWithHexNumber:@"FE93A2"]];
    [btnTwo addTarget:self action:@selector(twoClick) forControlEvents:UIControlEventTouchUpInside];
    [btnTwo setBackgroundImage:[UIImage imageNamed:@"体重"] forState:UIControlStateNormal];
    [btnTwo setRadius:btnOneW/2 borderWith:0 borderColor:nil];
    [self.scroll addSubview:btnTwo];
    
    
    self.twoLbl = [[UILabel alloc]init];
    self.twoLbl.text = @"称重";
    self.twoLbl.font = [UIFont fontWithName:@"HelveticaNeue" size:14];
    CGSize  twoLblSize = [_twoLbl.text sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:self.twoLbl.font,NSFontAttributeName ,nil]];
    CGFloat twoLblX = btnTwoX + btnTwoW/2 - twoLblSize.width/2 ;
    CGFloat twoLblY = CGRectGetMaxY(btnTwo.frame) +HJDVerticalMargin/2 ;
    self.twoLbl.frame = (CGRect){{twoLblX,twoLblY},twoLblSize};
    //    oneLbl.textAlignment = NSTextAlignmentCenter;
    self.twoLbl.textColor = [UIColor getColorWithHexNumber:@"848484"];
    [self.scroll addSubview:self.twoLbl];
    
    


}


-(void)setUpCell
{
    CGFloat viewMagrinX = 0;
    CGFloat viewMagrinY = CGRectGetMaxY(self.twoLbl.frame) + 25 ;
    
    CGFloat viewMagrinW = HJDWidth;
    CGFloat viewMagrinH = 50/2;
    UIView *viewMarin = [[UIView alloc]initWithFrame:CGRectMake(viewMagrinX, viewMagrinY, viewMagrinW, viewMagrinH)];
    
    viewMarin.backgroundColor = [UIColor getColorWithHexNumber:@"F1F1EE"];
    [self.scroll addSubview:viewMarin];
 
}




-(void)oneClick
{
    HJDNumberViewController *number = [[HJDNumberViewController alloc]init];
    [self.navigationController pushViewController:number animated:YES];
}

-(void)twoClick
{
    HJDWeightViewController *weight = [[HJDWeightViewController alloc]init];
//    [self presentViewController:weight animated:YES completion:nil];
    
    [self.navigationController pushViewController:weight animated:YES];
}


-(void)resultClick
{
    // 检测是否安装了QQ
    if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"mqq://"]]) {
        
        UIWebView * webView = [[UIWebView alloc] initWithFrame:CGRectZero];
        //貌似现在这个不能用了
        //    NSString * str = [NSString stringWithFormat:@"http://wpa.qq.com/msgrd?v=3&uin=%@&site=qq&menu=yes", @"742308143"];
        //记得plist文件里面要添加信任列表.
        NSString * string = @"mqq://im/chat?chat_type=wpa&uin=549952446&version=1&src_type=web";
        [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:string]]];
        [self.view addSubview:webView];
        NSLog(@"你安装了qq");
        
    }else{
        [MBProgressHUD  showError:@"你没有安装QQ"];
        NSLog(@"没有安装");
    }

    // 空白的webview
    

    NSLog(@"咨询");
}

-(void)nextDayClick
{
    NSLog(@"下一天");
}

-(void)upDayClick
{
    NSLog(@"上一天");
}

-(void)Back
{
    [self dismissViewControllerAnimated:YES completion:nil];
}


@end
